<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page isELIgnored="false" %>
<html>
<body>
<h2>我是服务器：${pageContext.request.localPort}</h2>
<h2>当前sessionId：${pageContext.session.id}</h2>
<h2>简历列表</h2>
<table border="1px">
    <thead>
        <th>
            <div align="left">
                <button onclick="logout()">注销</button>
            </div>
        </th>
        <th colspan="3">
            &nbsp;
        </th>
        <th colspan="5">
            <div align="right">
                <button onclick="insertnew()">新增</button>
            </div>
        </th>
    </thead>
    <thead>
        <th>编号</th>
        <th>姓名</th>
        <th>电话</th>
        <th>地址</th>
        <th>操作</th>
    </thead>
    <c:forEach items="${requestScope.list}" varStatus="keyword" var="resume" >
        <tr>
            <td>${resume.id}</td>
            <td>${resume.name}</td>
            <td>${resume.phone}</td>
            <td>${resume.address}</td>
            <td>
                <button onclick="edit('${resume.id}')">编辑</button>
                <button onclick="del('${resume.id}')">删除</button>
            </td>
        </tr>
    </c:forEach>
</table>
</body>
<script>
    function edit(eid){

        var url = "${pageContext.request.contextPath}/resume/edit/"+eid;
        window.location.href=url;

    }
    function del(eid){
        var url = "${pageContext.request.contextPath}/resume/del/"+eid;
        window.location.href=url;
    }
    function insertnew() {
        var url = "${pageContext.request.contextPath}/resume/insert";
        window.location.href=url;
    }

    function logout() {
        var url = "${pageContext.request.contextPath}/login/logout";
        window.location.href=url;
    }
</script>
</html>
